<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>退款</title>
    <link rel="stylesheet" href="__PUBLIC__/Home/css/memberOrder.css">
    <include file="Public/common_js"/>
</head>
<body>
<div class="warp">
    <!--退款top-->
    <div class="member-refund-top member-refund2">
        <i></i>
        <ul class="">
            <li><span>填写退款</span></li>
            <li class="active"><span>受理确认</span></li>
            <li><a href="memberRefund3.html"><span>完成退款</span></a></li>
        </ul>
    </div>
    <!--退款订单的信息-->
    <div class="member-refund-price mgTop">
        <p>
            <label>退款金额：</label>
            <span>{$refund.price}</span>
        </p>
        <p>
            <label>退款原因：</label>
            <span>{$refund.message}</span>
        </p>
        <p>
            <label>审核结果：</label>
            <span class="red">
                <if condition="$refund['status'] eq '0'">
                    未通过
                </if>
                <if condition="$refund['status'] eq '1'">
                    待审核
                </if>
                <if condition="$refund['status'] eq '2'">
                    审核通过
                </if>
                <if condition="$refund['status'] eq '7'">
                    取消申请
                </if>
            </span>
        </p>
    </div>
    <!--退款原因-->
    <div class="refund-mes-form refund-bottom mgTop">
        <div class="refund-mes-title">退款跟踪</div>
        <ul>
            <li class="refund-mes-card">
                <i></i>
                <div class="refund-mes-title">
                    提交申请
                    <span>{:get_refund_goods_time($refund['id'], 1)}</span>
                </div>
                <p>退款申请已经提交，客服将在1-2个工作日内受理。</p>
            </li>
            <if condition="$refund['status'] eq '0'">
                <li class="refund-mes-card mgTop">
                    <i></i>
                    <div class="refund-mes-title">
                        审核未通过
                        <span>{:get_refund_goods_time($refund['id'], 0)}</span>
                    </div>
                    <p>你的退款申请已被驳回<br/>如有疑问，请您拨打客服电话 <span class="sp-phone">{$mobile}</span></p>
                    <p class="mgTop"><a href="javascript:void(0);" class="btn btn-second btn-block reapply">重新申请</a></p>
                </li>
                <else/>
                <if condition="$refund['status'] eq '2'">
                    <li class="refund-mes-card mgTop">
                        <i></i>
                        <div class="refund-mes-title">
                            审核通过
                            <span>{:get_refund_goods_time($refund['id'], 2)}</span>
                        </div>
                        <p>我们会尽快处理你的退款金额<br/>如有疑问，请您拨打客服电话 <span class="sp-phone">{$mobile}</span></p>
                    </li>
                </if>
            </if>
            <if condition="$refund['status'] EQ '1'">
                <li class="refund-mes-card mgTop">
                    <p class="mgTop"><a href="javascript:void(0);" class="btn btn-second btn-block cancel_order">取消申请</a></p>
                </li>
            </if>
        </ul>
    </div>
</div>
<!-- 绑定手机弹窗 -->
<div class="alert-popup member-reminder" style="display: none">
    <p>如果您的订单还没有发货，可以拨打 {$mobile}联络发货人。</p>
    <p><a href="javascript:void(0);" class="cancel">取消</a><a href="tel://{$mobile}" class="confirm">拨打</a></p>
</div>
<script>require(['base'])</script>
</body>
</html>
<script>
    $('.reapply').click(function () {
        $.post("/MemberRefund/ajaxReplay",
            {
                order_id: "{$refund['order_id']}" ,
                id: "{$refund['id']}",
                sell: "{$sell}"
            },
            function (result) {
            if (result == 1) {
                window.location.reload();
            }else {
                alert('申请失败');
            }
        });
    });
    $('.cancel_order').click(function () {
        $.post("/MemberRefund/ajax_cancel_order",
            {
                order_id: "{$refund['order_id']}" ,
                id: "{$refund['id']}",
                sell: "{$sell}"
            },
            function (result) {
            if (result == 1) {
                window.location.reload();
            }else {
                alert('申请失败');
            }
        });
    });
</script>
